<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>配送佣金支付管理</title>
    <link rel="stylesheet" href="../../layui-v2.6.8/layui/css/layui.css">
    <script type="text/javascript" src="../../layui-v2.6.8/layui/layui.js"></script>
    <script type="text/javascript" src="../../js/jQuery%20v3.6.0.js"></script>
</head>
<body>
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
    <legend>查询员工工资详细信息</legend>
</fieldset>

<form class="layui-form" action="">
    <div class="layui-form-item">
        <div class="layui-inline">
            <div class="layui-inline">
                <label class="layui-form-label" style="font-size: 16px">员工编号：</label>
                <div class="layui-input-block">
                    <input type="text" id="eid" name="eid" class="layui-input" style="width: 200px">
                </div>
            </div>
            <button type="button" id="findById" class="layui-btn layui-btn-normal">查询</button>
        </div>
    </div>
    <table class="layui-hide" id="CommissionPayManage" lay-filter="operation"></table>
    </div>
</form>
<script>
    var table = layui.table;

    layui.use(['table'],function () {
        table.render({
            elem: '#CommissionPayManage',
            url: 'http://localhost:8080/searchSalary',
            toolbar: '#toolbarDemo',
            defaultToolbar: ['exports', 'print'],
            cols: [[
                 {field: 'eid', title: '员工编号', fixed: 'left', sort: true}
                , {field: 'ename', title: '员工姓名'}
                , {field: 'esalary', title: '工资/月'}
                , {field: 'epost', title: '工作岗位'}
                , {field: 'emonth', title: '员工工龄'}
                , {field: 'esum', title: '员工工资'}
            ]]
        });
    });
    $("#findById").click(function () {
        var eid=$('#eid').val();
        if(eid==null||eid==undefined||eid==""){
            layer.msg("请输入员工编号");
        }else {
            layer.open({
                area: ['100%', '200px'], //宽高
                title : ["查询结果","align:center"],
                content : '<div><table id="res"></table></div>',
                success: function () {
                    table.render({
                        elem: '#res',
                        url:  'http://localhost:8080/searchSalaryById?eid='+eid,
                        cols: [[
                            {field: 'eid', title: '员工编号', fixed: 'left', sort: true}
                            , {field: 'ename', title: '员工姓名'}
                            , {field: 'esalary', title: '工资/月'}
                            , {field: 'epost', title: '工作岗位'}
                            , {field: 'emonth', title: '员工工龄'}
                            , {field: 'esum', title: '员工工资'}
                        ]]
                    });
                }
            });
        }
    })
</script>
</body>
</html>